export const INITIALIZATION_MARK_NAMES = Object.freeze({
  INITIALIZATION_START: 'initialization-start',
  INITIALIZATION_END: 'initialization-end',
  CAN_ACCESS_STUDIO_AI_START: 'can-access-studio-ai-start',
  CAN_ACCESS_STUDIO_AI_END: 'can-access-studio-ai-end',
  CONNECT_PROTOCOL_TO_BROWSER_START: 'connect-protocol-to-browser-start',
  CONNECT_PROTOCOL_TO_BROWSER_END: 'connect-protocol-to-browser-end',
  INITIALIZE_STUDIO_AI_START: 'initialize-studio-ai-start',
  INITIALIZE_STUDIO_AI_END: 'initialize-studio-ai-end',
} as const)

type InitializationMarkName = (typeof INITIALIZATION_MARK_NAMES)[keyof typeof INITIALIZATION_MARK_NAMES]

export const INITIALIZATION_MEASURE_NAMES = Object.freeze({
  INITIALIZATION_DURATION: 'initialization-duration',
  CAN_ACCESS_STUDIO_AI_DURATION: 'can-access-studio-ai-duration',
  CONNECT_PROTOCOL_TO_BROWSER_DURATION: 'connect-protocol-to-browser-duration',
  INITIALIZE_STUDIO_AI_DURATION: 'initialize-studio-ai-duration',
} as const)

type InitializationMeasureName = (typeof INITIALIZATION_MEASURE_NAMES)[keyof typeof INITIALIZATION_MEASURE_NAMES]

export const INITIALIZATION_MEASURES: Record<InitializationMeasureName, [InitializationMarkName, InitializationMarkName]> = Object.freeze({
  [INITIALIZATION_MEASURE_NAMES.INITIALIZATION_DURATION]: [
    INITIALIZATION_MARK_NAMES.INITIALIZATION_START,
    INITIALIZATION_MARK_NAMES.INITIALIZATION_END,
  ],
  [INITIALIZATION_MEASURE_NAMES.CAN_ACCESS_STUDIO_AI_DURATION]: [
    INITIALIZATION_MARK_NAMES.CAN_ACCESS_STUDIO_AI_START,
    INITIALIZATION_MARK_NAMES.CAN_ACCESS_STUDIO_AI_END,
  ],
  [INITIALIZATION_MEASURE_NAMES.CONNECT_PROTOCOL_TO_BROWSER_DURATION]: [
    INITIALIZATION_MARK_NAMES.CONNECT_PROTOCOL_TO_BROWSER_START,
    INITIALIZATION_MARK_NAMES.CONNECT_PROTOCOL_TO_BROWSER_END,
  ],
  [INITIALIZATION_MEASURE_NAMES.INITIALIZE_STUDIO_AI_DURATION]: [
    INITIALIZATION_MARK_NAMES.INITIALIZE_STUDIO_AI_START,
    INITIALIZATION_MARK_NAMES.INITIALIZE_STUDIO_AI_END,
  ],
} as const)

export const INITIALIZATION_TELEMETRY_GROUP_NAMES = Object.freeze({
  INITIALIZE_STUDIO: 'initialize-studio',
} as const)

type InitializationTelemetryGroupName = (typeof INITIALIZATION_TELEMETRY_GROUP_NAMES)[keyof typeof INITIALIZATION_TELEMETRY_GROUP_NAMES]

export const INITIALIZATION_TELEMETRY_GROUPS: Record<InitializationTelemetryGroupName, InitializationMeasureName[]> = Object.freeze({
  [INITIALIZATION_TELEMETRY_GROUP_NAMES.INITIALIZE_STUDIO]: [
    INITIALIZATION_MEASURE_NAMES.INITIALIZATION_DURATION,
    INITIALIZATION_MEASURE_NAMES.CAN_ACCESS_STUDIO_AI_DURATION,
    INITIALIZATION_MEASURE_NAMES.CONNECT_PROTOCOL_TO_BROWSER_DURATION,
    INITIALIZATION_MEASURE_NAMES.INITIALIZE_STUDIO_AI_DURATION,
  ],
} as const)
